package com.huanghuai.retail.utils;
import java.text.SimpleDateFormat;
import java.util.Date;

//出入库单据编号生成
//单据类型+日期+仓库
public class OPRepositoryNumsUtils {
        /**
         * 采购入库     +日期+4位流水
         */
        public static final String ODDNUM_CGRK = "CGRK";
        /**
         *  其他入库   +日期+4位流水
         */
        public static final String ODDNUM_QTRK = "QTRK";
        /**
         * 销售退货入库     +日期+4位流水
         */
        public static final String ODDNUM_XSTHRK = "XSTHRK";
        /**
         * 采购退货出库     +日期+4位流水
         */
        public static final String ODDNUM_CGTHCK = "CGTHCK";
        /**
         *  销售出库   +日期+4位流水
         */
        public static final String ODDNUM_XSCK = "XSCK";
        /**
         * 其他出库     +日期+4位流水
         */
        public static final String ODDNUM_QTCK= "QTCK";



        public static int getNowTimeCode() {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
            int nowTimeCode = Integer.parseInt(simpleDateFormat.format(new Date()).substring(0, 8));
            return nowTimeCode;
        }
       public static String createRepNums(String name,Long repId){

            return name+getNowTimeCode()+repId;
       }


    }


